package thread;

class MyThread3 extends Thread {
    //从运行结果可以清晰地看出start()和run()的区别
    @Override
    public void run() {
        while(true){
            System.out.println("try");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}

public class Thread_start_and_run {
    public static void main(String[] args) {
        Thread t = new MyThread3();
        t.start();
        //t.run();
        while(true){
            System.out.println("try everything");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
